﻿using System;
using System.ComponentModel;

namespace Loki.Utils
{
    /// <summary>
    /// Common interface for centralized state change.
    /// </summary>
    public interface ICentralizedChangeTracking : INotifyPropertyChanged, ISupportInitialize
    {
        /// <summary>
        /// Gets a value indicating whether this instance is dirty.
        /// </summary>
        /// <value>
        ///   Value is <c>true</c> if this instance is dirty; otherwise, <c>false</c>.
        /// </value>
        bool IsDirty { get; }

        /// <summary>
        /// Starts the change tracking.
        /// </summary>
        void AcceptChanges();

        /// <summary>
        /// Occurs when internal state changed.
        /// </summary>
        event EventHandler StateChanged;
    }
}
